<!-- 我的钱包 -->
<template>
	<view class="wallet-wrap">
		<ljshop-navbar :background="{ background: 'none' }" backText="我的补贴" backIconColor="#333"></ljshop-navbar>
		<view class="head_box u-flex u-row-center u-col-center">
			<view class="card-box">
				<view class="card-head u-flex u-col-center">
					<view class="card-title u-m-r-10">推广补贴（元）</view>
					<view @tap="showMoney = !showMoney" class="u-iconfont"
						:class="showMoney ? 'uicon-eye' : 'uicon-eye-off'" style="color: #fff;font-size: 46rpx;"></view>
				</view>
				<view class="card-head u-flex  uni-row u-p-t-40" style="-webkit-flex: 1;flex: 1;">
					<view style="-webkit-flex: 1;flex: 1; " class="money-num">
						{{ showMoney ? Distributionincome_payment.toFixed(2) || '0.00' : '*****' }}
					</view>
					<view style="-webkit-flex: 1;flex: 1;" class="card-head u-flex">

						<view style="-webkit-flex: 1;flex: 1;">
							<view class="title u-ellipsis-1">预估补贴</view>
							<view class="add font-OPPOSANS">
								{{Distributionorder_payment?Distributionorder_payment.toFixed(2):'0.00'}}
							</view>
						</view>
					</view>
				</view>
				<button class="u-reset-button withdraw-btn"
					@tap="$Router.push('/pages/user/subsidy/distribution')">记录</button>
			</view>
		</view>
		<view class="head_box u-flex u-row-center u-col-center">
			<view class="card-box">
				<view class="card-head u-flex u-col-center">
					<view class="card-title u-m-r-10">自购补贴（元）</view>
					<view @tap="showMoney = !showMoney" class="u-iconfont"
						:class="showMoney ? 'uicon-eye' : 'uicon-eye-off'" style="color: #fff;font-size: 46rpx;"></view>
				</view>
				<view class="card-head u-flex  uni-row u-p-t-40" style="-webkit-flex: 1;flex: 1;">
					<view style="-webkit-flex: 1;flex: 1; " class="money-num">
						{{ showMoney ? shopincome_payment || '0.00' : '*****' }}
					</view>
					<view style="-webkit-flex: 1;flex: 1;" class="card-head u-flex">

						<view style="-webkit-flex: 1;flex: 1;">
							<view class="title u-ellipsis-1">预估补贴</view>
							<view class="add font-OPPOSANS">{{shoporder_payment?shoporder_payment.toFixed(2):'0.00'}}
							</view>
						</view>
					</view>
				</view>
				<button class="u-reset-button withdraw-btn" @tap="$Router.push('/pages/user/subsidy/self')">记录</button>
			</view>
		</view>
		<view class="head_box u-flex u-row-center u-col-center">
			<view class="card-box">
				<view class="card-head u-flex u-col-center">
					<view class="card-title u-m-r-10">对接补贴（元）</view>
					<view @tap="showMoney = !showMoney" class="u-iconfont"
						:class="showMoney ? 'uicon-eye' : 'uicon-eye-off'" style="color: #fff;font-size: 46rpx;"></view>
				</view>
				<view class="card-head u-flex  uni-row u-p-t-40" style="-webkit-flex: 1;flex: 1;">
					<view style="-webkit-flex: 1;flex: 1; " class="money-num">
						{{ showMoney ? Waiterincome_payment.toFixed(2) || '0.00' : '*****' }}
					</view>
					<view style="-webkit-flex: 1;flex: 1;" class="card-head u-flex">

						<view style="-webkit-flex: 1;flex: 1;">
							<view class="title u-ellipsis-1">预估补贴</view>
							<view class="add font-OPPOSANS">{{Waiterorder_payment?Waiterorder_payment.toFixed(2):'0.00'}}
							</view>
						</view>
					</view>
				</view>
				<button class="u-reset-button withdraw-btn"
					@tap="$Router.push('/pages/user/subsidy/service')">记录</button>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		mapMutations,
		mapActions,
		mapState,
		mapGetters
	} from 'vuex';
	export default {
		components: {},
		data() {
			return {
				isEmpty: false,
				stateCurrent: 'all', //默认

				showMoney: true,
				//日期选择
				showCalendar: false,
				selDateText: '',
				walletLog: [], //钱包记录
				propsDate: '', //日期参数
				incomeMoney: '', //收入
				expendMoney: '', //支出
			
				currentPage: 0,
				lastPage: 0,
				shopincome_payment: 0,
				shoporder_payment: 0,
				Distributionincome_payment: 0,

				Distributionorder_payment: 0,
				Waiterincome_payment: 0,
				Waiterorder_payment: 0,
			};
		},
		computed: {
			...mapGetters(['isLogin', 'userInfo'])
		},
		onShow() {
			 
			this.getWalletLog();
		},
		// 触底加载更多
		onReachBottom() {
			if (this.currentPage < this.lastPage) {
				this.currentPage += 1;
				this.getWalletLog();
			}
		},
		methods: {
			getWalletLog() {
				let that = this;
			
				that.$http('money.getAll', {
					UId: uni.getStorageSync("UId"),
				}).then(res => {
			 
					
					if (res.code === 1) {
						this.shopincome_payment = res.shopincome_payment
						this.shoporder_payment = res.shoporder_payment
						this.Distributionincome_payment = res.Distributionincome_payment
						this.Distributionorder_payment = res.Distributionorder_payment
						this.Waiterincome_payment = res.Waiterincome_payment
						this.Waiterorder_payment = res.Waiterorder_payment
					}
				});
			}
		}
	};
</script>

<style lang="scss">
	// 钱包记录
	.flex-item {
		width: 33.3%;
		height: 200rpx;
		text-align: center;
		line-height: 200rpx;
	}

	.flex-item-V {
		width: 100%;
		height: 150rpx;
		text-align: center;
		line-height: 150rpx;
	}

	.text {
		margin: 15rpx 10rpx;
		padding: 0 20rpx;
		background-color: #ebebeb;
		height: 70rpx;
		line-height: 70rpx;
		text-align: center;
		color: #777;
		font-size: 26rpx;
	}

	.desc {
		/* text-indent: 40rpx; */
	}

	.flex-pc {
		display: flex;
		justify-content: center;
	}

	.wallet-list {
		width: 750rpx;
		padding: 30rpx;
		background-color: #ffff;
		border-bottom: 1rpx solid #eeeeee;

		.head-img {
			width: 70rpx;
			height: 70rpx;
			border-radius: 50%;
			background: #ccc;
		}

		.list-content {
			justify-content: space-between;
			align-items: flex-start;
			flex: 1;

			.title {
				font-size: 28rpx;
				color: #333;
				width: 400rpx;
			}

			.time {
				color: #c0c0c0;
				font-size: 22rpx;
			}
		}

		.money {
			font-size: 28rpx;
			font-weight: bold;

			.add {
				color: #7063d2;
			}

			.minus {
				color: #333333;
			}
		}
	}

	// 钱包
	.head_box {
		width: 750rpx;
		background-color: #fff;
		padding: 30rpx 0;

		.card-box {
			width: 690rpx;
			min-height: 300rpx;
			padding: 40rpx;
			background: url('https://image.hzwltb69.com/app/images/money_wallet_bg.png') no-repeat;
			background-size: 100% 100%;
			box-shadow: 1rpx 5rpx 16rpx 0 rgba(94, 73, 195, 0.81);
			border-radius: 30rpx;
			overflow: hidden;
			position: relative;

			.card-head {
				color: #fff;
				font-size: 30rpx;
			}

			.money-num {
				font-size: 70rpx;
				line-height: 70rpx;
				font-weight: 500;
				color: #ffffff;
			}

			.reduce-num {
				font-size: 26rpx;
				font-weight: 400;
				color: #ffffff;
			}

			.withdraw-btn {
				width: 180rpx;
				height: 60rpx;
				line-height: 60rpx;
				background: #ffffff;
				border-radius: 30px;
				font-size: 24rpx;
				font-weight: 500;
				color: #5848c4;
				position: absolute;
				right: 30rpx;
				top: 40rpx;
			}

			.topup-btn {
				width: 120rpx;
				height: 60rpx;
				line-height: 60rpx;
				border-radius: 30px;
				font-size: 24rpx;
				font-weight: 500;
				color: #fff;
				border: 1px solid #fff;
				position: absolute;
				right: 180rpx;
				top: 40rpx;
			}
		}
	}

	// 筛选

	.filter-box {
		height: 120rpx;
		padding: 0 30rpx;
		background-color: #f6f6f6;

		.date-btn {
			background-color: #fff;
			line-height: 54rpx;
			border-radius: 27rpx;
			padding: 0 20rpx;
			font-size: 24rpx;
			font-weight: 500;
			color: #666666;
		}

		.total-box {
			font-size: 24rpx;
			font-weight: 500;
			color: #999999;
		}
	}

	// 分类
	.state-item {
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background-color: #fff;
		border-bottom: 1rpx solid rgba(#999, 0.5);

		.state-title {
			color: #666;
			font-weight: 500;
			font-size: 28rpx;
			line-height: 90rpx;
		}

		.title-active {
			color: #333;
		}

		.underline {
			display: block;
			width: 68rpx;
			height: 4rpx;
			background: #fff;
			border-radius: 2rpx;
		}

		.underline-active {
			background: #5e49c3;
			display: block;
			width: 68rpx;
			height: 4rpx;
			border-radius: 2rpx;
		}
	}
</style>
